package cn.edu.zut.service.Impl;

import cn.edu.zut.dao.UserDao;
import cn.edu.zut.domain.User;
import cn.edu.zut.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    public UserDao dao;

    @Override
    public User findByUserName(String userName) {
        return dao.findByUserName(userName);
    }

    @Override
    public void insert(User user) {
        dao.insert(user);
    }


    @Override
    public void update(User user) {
        dao.update(user);
    }

    @Override
    public List<User> findAll() {
        return dao.findAll();
    }

    @Override
    public List<User> findAllUsers() { return dao.findAllUsers(); }

    @Override
    public void deleteByUserName(String userName) {
        dao.deleteByUserName(userName);
    }

    @Override
    public List<User> findByLikeUserName(User user) {
        return dao.findByLikeUserName(user);
    }

    @Override
    public List<User> findPart(int offset, int maxNumber) {
        return dao.findPart(offset, maxNumber);
    }
}
